package com.diandiansong.app.ui.base;

import android.os.Bundle;

import com.diandiansong.app.event.FINISH;
import com.diandiansong.app.ui.user.Login;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * 界面基类
 */
public class BaseAct extends diandiansong.library.ui.base.BaseAct {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EventBus.getDefault().register(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void do401(FINISH f) {
        Login.start(getActivity());
        finish();
    }
}
